export enum PlantMap {
    sunflower = 2,
    pease = 1
}

export enum GameState{
    unready = -1,
    ready = 0,
    gameOver = 2,
    gamePause = 1
}

export class GameData  {
    private static instance = null
    // 太阳能量总数
    totalSunEnergy = 0
    selectType = -1 // 选中的类型
    gameState = GameState.unready

    static getInstance(){
        if(!GameData.instance){
            GameData.instance = new GameData()
        }
        return GameData.instance
    }
    setSelectType(type: number){
        this.selectType = type
    }
    setSunEnergy(num: number){
        this.totalSunEnergy += num
    }
    setGameState(state: GameState){
        this.gameState = state
    }
}

